<#if controllerVars.importAnnotationClassDefineArea?has_content>
${abs.importAnnotationClassDefineAreaStartMark}
${controllerVars.importAnnotationClassDefineArea}
${abs.importAnnotationClassDefineAreaEndMark}
<#else>
${abs.importAnnotationClassDefineAreaStartMark}
package ${controllerVars.packageName};

import ${apiVars.packageName}.${entity}Api;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import org.springframework.web.bind.annotation.RequestBody;
import ${bizServiceVars.packageName}.${entity}BizService;
import ${bizRequestDTOVars.packageName}.${entity}BizRequestDTO;
import ${bizResponseDTOVars.packageName}.${entity}BizResponseDTO;
import com.xieyang.inner.common.rpc.XRequest;
import com.xieyang.inner.common.rpc.XResponse;
import ${bizRequestBOVars.packageName}.${entity}BizRequestBO;
import ${bizResponseBOVars.packageName}.${entity}BizResponseBO;
import com.xieyang.inner.common.exception.XBizException;
import com.xieyang.inner.common.spring.util.XBeanUtils;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Resource;
<#if superControllerClassPackage??>
import ${superControllerClassPackage};
</#if>

/**
 * <p>
 * ${table.comment!} api接口实现
 * </p>
 *
 */
<#if superControllerClass??>
public class ${table.controllerName} extends ${superControllerClass} implements ${entity}Api {
<#else>
@Api(tags = "${table.comment!}-相关接口")
@Slf4j
public class ${table.controllerName} implements ${entity}Api {
</#if>
${abs.importAnnotationClassDefineAreaEndMark}
</#if>

    @Resource
    private ${entity}BizService ${entity?substring(0,1)?lower_case + entity?substring(1)}BizService;

    @Override
    public XResponse<${entity}BizResponseDTO> biz(@RequestBody XRequest<${entity}BizRequestDTO> request) {
        long begin = System.currentTimeMillis();
        try {
            ${entity}BizResponseBO ${entity?substring(0,1)?lower_case + entity?substring(1)}BizResponseBO = ${entity?substring(0,1)?lower_case + entity?substring(1)}BizService.biz(XBeanUtils.convert(request.getData(), ${entity}BizRequestBO.class));
            log.info("响应参数：{}", JSONObject.toJSONString(${entity?substring(0,1)?lower_case + entity?substring(1)}BizResponseBO, SerializerFeature.WriteMapNullValue));
            return XResponse.success(XBeanUtils.convert(${entity?substring(0,1)?lower_case + entity?substring(1)}BizResponseBO, ${entity}BizResponseDTO.class));
        } catch (XBizException e) {
            XResponse<${entity}BizResponseDTO> response = XResponse.error(e.getStatus(), e.getMsg(), null);
            response.setStatus(e.getStatus());
            response.setExtraInfo(e.getExtraInfo());
            response.setData(new ${entity}BizResponseDTO());
            return response;
        } finally {
            log.info("业务耗时ms：{}", System.currentTimeMillis() - begin);
        }
    }


    ${abs.customerAreaStartMark}
${controllerVars.customerArea}
    ${abs.customerAreaEndMark}

}

